<div id="userBG">
  <div id="userp_width">
    <div id="userp_container" align="center">
      
      <!-- TODO Need to create new background image for the flash messages that appear on black backgrounds. -->
      <% if flash[:notice] %>
      	<h1><%= flash[:notice] %></h1>
        <br/>
      <% end %>
   	  
   	  <% form_for :user, :url => user_path(@user), :html => { :method => :put, :id => :thisform } do |form| %>    
  		  <div id="user_border"> 

  		    <div id="user_bar">
  		      <h2>Edit <%= @user.login %></h2>
  		      <div id="clear"></div>
  		    </div>
	      
  	      <div id="lognpass">
            <br />

            <table>
  	          <tr>
                <th width="215">First Name: </th>
                <td width="408"><%= form.text_field :first_name, :size => 50 %></td>
              </tr>
  	          <tr>
                <th>Last Name: </th>
                <td><%= form.text_field :last_name, :size => 50 %></td>
              </tr>
              <tr>
                <th>Email: </th>
                <td><%= form.text_field :email, :size => 50 %></td>
              </tr>
  	          <tr>
                <th>Login: </th>
                <td><%= form.text_field :login, :size => 50 %></td>
              </tr>
            </table>
            
            <% if current_user.is_admin? %>
              <ul class="right">
                <li class="horizontal">
                  <%= link_to "delete this user", user_path(@user), :confirm => "Are you sure?!", :method => :delete %>
                </li>
              </ul>
          
              <br/>
            
              <div id="user_bar">
      		      <h2>Roles (check to give roles)</h2>
      		      <div id="clear"></div>
      		    </div>
  		    
      		    <br/>
  		    
      		    <table>
      		      <% Role.find(:all).each do |role| %>
      		        <tr>
      		          <th><%= role.name %></th>
      		          <td><%= check_box_tag "user[role_ids][]", role.id, @user.roles.include?(role) %></td>
      		        </tr>
      				  <% end %>
      				</table>
    				<% end %>
  				  				
          </div>
                
  	      <div align="right" id="formbtn">
  	        <%= submit_tag  "update", 
  	                        :class => "btn", 
  	                        :onmouseover => "this.className='btn btnhov'", 
  	                        :onmouseout => "this.className='btn'" 
  	        %>
  	      </div>

  		  </div>
  	  <% end %>

    	<% form_for :user, :url => user_path(@user), :html => { :method => :put, :id => :thisform } do |form| %>
  	    <div id="user_border">  	    
  		
    		  <div id="user_bar">
    		    <h2>Change Password</h2>
    		    <div id="clear"></div>
    		  </div>
    	  
      	  <div id="lognpass">
            <br />
            <table>
  	          <tr>
                <th width="215">Enter new password: </th>
                <td width="408"><%= form.password_field :password, :size => 50 %></td>
              </tr>
  	          <tr>
                <th>Re-enter new password: </th>
                <td><%= form.password_field :password_confirmation, :size => 50 %></td>
              </tr>
            </table>
          </div>
        
          <div align="right" id="formbtn">
            <%= submit_tag  "change password", 
                            :class => "btn", 
                            :onmouseover => "this.className='btn btnhov'", 
                            :onmouseout => "this.className='btn'" 
            %>
          </div>
    	  </div>
    	<% end %>
  	  
    </div>
  </div>
</div>